package com.zt.chatgpt.types.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: zt
 * @Description: 选择模型渠道
 * @create: 2024-05-22 23:36
 */

@AllArgsConstructor
@Getter
public enum OpenAiChannel {
    CHATGPT("CHATGPT"),
    CHATGLM("CHATGLM");

    private final String code;
    public static OpenAiChannel getChannel(String model) {
        if (model.toLowerCase().contains("glm")) {
            return OpenAiChannel.CHATGLM;
        }
        if (model.toLowerCase().contains("gpt")) {
            return OpenAiChannel.CHATGPT;
        }
        return null;
    }
}
